#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {

    int pa, pb, a, b, c;
    cin >> pa >> pb >> a >> b >> c;

    if( (pa > pb && a + b + c < 3) || (pa < pb && a + b + c == 0) )
        cout << "The winner is a: " << pa << " + " << 3 - a - b - c;
    else
        cout << "The winner is b: " << pb << " + " << a + b + c;
    return 0;
}

